-
Notifications
You must be signed in to change notification settings - Fork 27
INTPYTHON-602 Fix loading of embedded model fields that use database converters #295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
return None | ||
# Apply database converters to each field of the embedded model. | ||
for field in self.embedded_model._meta.fields: | ||
expression = Col("", field) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔 I think an Expression(output_field=field) is a better approach, it is more minimalistic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've amended this PR since the from_db_value()
approach doesn't work for nested models.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't remain what the old code looks like. is It fixed now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewing the unit test, show that is working now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it. New converted is added that apply the needed converters.
…database converters
No description provided.